package assemblerNG;

public class Microinstruction {
		
	private String aAddr, bAddr, aluOp, switchPos, cAddr, memWrite, directOperand;
	           //    3      3       4       4        3        1          8          || 34 bits

	public String getaAddr() {
		return aAddr;
		//R0 = 000
		//R4 = 011
		//Rdados = 100
		//PC = 111
	}

	public void setaAddr(String aAddr) {
		this.aAddr = aAddr;
	}

	public String getbAddr() {
		return bAddr;
	}

	public void setbAddr(String bAddr) {
		this.bAddr = bAddr;
	}

	public String getAluOp() {
		return aluOp;
		// A+B 0000
		// A-B 0001
		// SHL 0010
		// SHR 0011
		// A&B 0100
		// A|B 0101
		// NOT 0110
		// NEG 0111
		// JZ  0111 ou JE - zero=1
		// JS  1000 ou JL - signal=1
		// JC  1001 carry=1
		// JG  1010 tudo zero
		// CMP 1011 nao faz nada
		// JMP 1100 nao olha nada
		// RESERVADO 1101
		// NOP 1110
		// HALT 1111
	}

	public void setAluOp(String aluOp) {
		this.aluOp = aluOp;
	}

	public String getSwitchPos() {
		return switchPos;
	}

	public void setSwitchPos(String switchPos) {
		this.switchPos = switchPos;
	}

	public String getcAddr() {
		return cAddr;
	}

	public void setcAddr(String cAddr) {
		this.cAddr = cAddr;
	}

	public String getMemWrite() {
		return memWrite;
	}

	public void setMemWrite(String memmoryAddr) {
		this.memWrite = memmoryAddr;
	}

	public String getDirectOperand() {
		return directOperand;
	}

	public void setDirectOperand(String directOperand) {
		this.directOperand = directOperand;
	}
	
	public String getMicro() {
		return aAddr + bAddr + aluOp + switchPos + cAddr + memWrite + directOperand;
	}
	
	public void flushMicro() {
		aAddr = null; 
		bAddr = null;
		aluOp = null; 
		switchPos = null; 
		cAddr = null; 
		memWrite = null; 
		directOperand = null;
	}
	

}
